#include <QGuiApplication>
#include "glwidget.h"

int main(int argc, char *argv[])
{
    QGuiApplication a(argc, argv);

    /*设置OpenGL版本信息
     * 注：该format要在show()调用前被设置*/
    QSurfaceFormat format;
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setVersion(3, 3);

    GLWidget w;
    w.setFormat(format);
    w.resize(QSize(640, 480));
    w.show();

    return a.exec();
}

